home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / BASIC / 3064.ZIP / LINKER.ZIP / LINKER.DOC < prev    next >
Text File  |  1990-12-01  |  24KB  |  503 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                 The QuickBASIC
  22.  
  23.                           Compiler/Linker Assistant
  24.  
  25.                                  Version 1.2
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.       (C) Copyright 1990 by Robin Duffy and Sequential Software Limited.
  35.                              All rights reserved.
  36.  
  37.             QuickBASIC is a registered trademark of Microsoft Inc.
  38.  
  39.  
  40.  
  41.  
  42.                      SECTION ONE: Introduction to L.EXE
  43.  
  44.     1.1 Program Overview
  45.  
  46.             L.EXE is a utility designed to help compile and link stand
  47.        alone programs from QuickBASIC 4.0+ source code. It operates much
  48.        like the compile options from within the environment but allows
  49.        you total control over the compiling and linking process. After
  50.        setting the options YOU want, simply press one key and let L.EXE
  51.        do the work for you!
  52.  
  53.             Why compile and link away from QuickBASIC? Good question. By
  54.        compiling away from the environment you can create smaller
  55.        programs that execute faster. For example, if your program does
  56.        not require use of the COM port, the code is STILL ADDED anyway.
  57.        Linking your program with NOCOM.OBJ (as supplied with QB 4) will
  58.        eliminate the extra code - if you link from the command line.
  59.        Another good example is using ON ERROR. ON ERROR has two
  60.        different sets of code, but both are added even if you only use
  61.        one of them. By setting your own options you can eliminate a lot
  62.        of useless code and gain speed as a benefit.
  63.  
  64.             Compiling and linking from the DOS command line is fairly
  65.        simple if you are compiling only one module and linking with only
  66.        one library. Start adding modules and the process gets more
  67.        involved, fast. Worse yet, most "toolboxes" come as libraries you
  68.        must add, and there are stub files to add as well. Almost a hopeless
  69.        situation - until L.EXE.
  70.  
  71.             Tell L.EXE what compiler options you want. Set your own
  72.        link options as well. Specify three (or more) libraries and
  73.        throw in a couple of stub files to boot. Give it the name of your
  74.        source file and press a key. L.EXE will give all the necessary
  75.        commands to compile your source code. Multiple modules? No problem.
  76.        L.EXE will find your MAKE file and add the needed modules automatic-
  77.        ally. Compiling and linking away from the QB environment need not be
  78.        difficult - if you have the right tool.
  79.  
  80.     1.2 Requirements for L.EXE
  81.  
  82.             L.EXE requires DOS 3.0 or later and at least 256K system
  83.        memory in order to operate. You may use L.EXE with one disk
  84.        drive although a hard disk is strongly recommended for best
  85.        operation. This program is intended to be used with BC.EXE and
  86.        LINK.EXE as provided with QuickBASIC 4.0 + 4.5 and has not
  87.        been tested with other compilers.
  88.  
  89.             COMMAND.COM must be available to L.EXE through the COMSPEC
  90.        environment variable. Usually this poses no problem - COMSPEC is
  91.        set by DOS to the drive you booted from. In single drive systems,
  92.        however, this could become a problem. See the section called
  93.        "Compiling and Linking Your Program" for information concerning
  94.        this problem and a possible solution.
  95.  
  96.             In addition to all this you will need your own source
  97.        files and your own libraries. L.EXE is meant as an interface
  98.        for QB only and does not provide the programs necessary for
  99.        compiling and linking source files. This is left up to you to
  100.        provide.
  101.  
  102.     1.3 Support Files for L.EXE
  103.  
  104.             In the course of normal operation L.EXE uses and creates
  105.        several files. Listed below are some of these files and their
  106.        respective notes.
  107.  
  108.             L.HLP - This file contains the help screens for L.EXE.
  109.             It should be placed in the same directory as L.EXE for
  110.             proper operation. L.EXE can function without this file but
  111.             then help will not be available.
  112.  
  113.             *.LNK - These files are created by the program when you
  114.             push the F2 key (see "Program Operation" for more info).
  115.             These files are created in the directory where L.EXE is
  116.             located regardless of the current directory.
  117.  
  118.             BC.EXE - The QuickBASIC compiler program versions 4.0 or 4.5.
  119.             L.EXE has not been tested with earlier versions.
  120.  
  121.             LINK.EXE - As supplied with QuickBASIC.
  122.  
  123.             *.OBJ - These are the compiled source object files and stub
  124.             files. BC will create these in the current directory. Link will
  125.             then use these to create the finished program.
  126.  
  127.             *.LIB - The various library files. One is BCOM45.LIB, which
  128.             is generally used for stand-alone EXE files. Toolbox kits
  129.             often come in the form of libraries which can also be added.
  130.  
  131.             *.BAS - Your BASIC source files.
  132.  
  133.             *.MAK - If you use multiple modules QB will create a file
  134.             with a .MAK extension containing a list of all modules
  135.             included with your code. If it exists, L.EXE will read this
  136.             file and add the specified modules to your program
  137.             automatically.
  138.  
  139.             There is quite a bit to keep track of while compiling and
  140.        linking programs. You can see that without a utility such as
  141.        this creating stand-alones can be a grueling process. L.EXE can
  142.        allow you to benefit from separate compiling and linking while
  143.        shielding you from the rigors of such a process. The next section
  144.        tells you how.
  145.  
  146.                         SECTION TWO: Program Operation
  147.  
  148.     2.1 Getting Started
  149.  
  150.             To start the program type "L" (without quotes) from the DOS
  151.        prompt. This will start the program and display the main screen.
  152.        You may also use the command line switches to alter the operation of
  153.        the program. The command line options are:
  154.  
  155.                /Q - Select quiet mode. This will turn off the alarms
  156.                present in L.EXE. Please note this will not silence the
  157.                beeps given by BC.EXE should errors occur.
  158.  
  159.                /R Filename - will read a data file at start up. See the
  160.                section on multiple data files for more information.
  161.  
  162.                /C Filename - will compile a data file in batch mode. See
  163.                the section on command line operation for more information.
  164.  
  165.             The main screen is divided into three main sections of
  166.        information that you will need to enter. Some fields are optional
  167.        while others are required. To enter information just type it in. You
  168.        can use the up/down arrow keys to move from field to field. Please
  169.        note the text in the current field is in high intensity - this will
  170.        help you distinguish the field you are in. While entering information
  171.        you may use the insert/del keys as well as the left/right arrows.
  172.        Let's now look at the top section of information.
  173.  
  174.             The top section consists of path information concerning your
  175.        computer set up. It is necessary for L.EXE to know where you
  176.        keep certain items. Please enter the path to your source file
  177.        directory, the directory where you keep BC and LINK, your library
  178.        directory, and where you keep stub files. When specifying paths the
  179.        drive parameter is optional. For hard disk use both of the following
  180.        examples are valid:
  181.                              c:\qb\basfiles
  182.                              \qb\library
  183.  
  184.             If you leave a path blank L.EXE will use the current directory.
  185.  
  186.             L.EXE is set up to allow maximum organization of your hard
  187.        disk. If you are using a one or two drive system please see the
  188.        sections dealing will those situations under "Compiling and
  189.        Linking Your Program" elsewhere in this text.
  190.  
  191.             The middle section is where you specify your options for BC
  192.        and LINK, what libraries you want to link with, and any stub files
  193.        you may want to add to your program. The options for BC and LINK are
  194.        in the form of command line switches. Specify these switches as
  195.        though you were giving them on the command line (ie: /o /s /t for
  196.        BC.EXE)
  197.  
  198.             There is one field for compiler options and two for link
  199.        options. There are up to 27 different options you can specify for
  200.        LINK, so the extra field has been added. You may use either of
  201.        the link option fields or a combination of both.
  202.  
  203.  
  204.             Next specify which libraries you wish to link with. Multiple
  205.        libraries can be specified by separating each library in this field
  206.        by a space. The libraries are presented to LINK in the order you
  207.        give them. Giving a path with a library will override the path given
  208.        in the top section.
  209.  
  210.             Stub files are any special purpose object files you may want to
  211.        add to your program. These are object files such as NOCOM.OBJ,
  212.        NOEM.OBJ, and SMALLERR.OBJ. By using object files such as these you
  213.        can shrink the size of your code dramatically. If you plan to use
  214.        multiple stub files be sure to separate each name in the field by a
  215.        space. Giving a path with a stub file will override the path given
  216.        in the top section.
  217.  
  218.             You can fit more names in each field by not giving an extension.
  219.        Extensions are not necessary for any of the information you enter.
  220.        L.EXE, BC, and LINK know what the extensions are and will add them
  221.        for you.
  222.  
  223.             The final section is where you tell L.EXE what source file
  224.        you wish to compile and the name you want to give it. The source
  225.        name field is designed to accept only ONE file name. If your program
  226.        consists of several separate modules QB will create a make file in
  227.        your source directory containing all the modules to your program.
  228.        L.EXE will read this file if it exists and add all the modules in
  229.        the make file to your program. The compiler options you specify will
  230.        be applied to all modules so they  are all compiled the same.
  231.        Consult your QB manual for more information about .MAK files.
  232.  
  233.             In the last field place the name you wish to give your
  234.        program. If you desire the same name as your source file just
  235.        leave this field blank. The extension .EXE is assumed. You may also
  236.        enter a path to create the file in a different directory.
  237.  
  238.     2.2 Multiple Data Files
  239.  
  240.             L.EXE can save the information you have entered into a data
  241.        file. You may store a virtually unlimited number of different data
  242.        files. After entering data press the F2 key. L.EXE will save the
  243.        data into a file with the same name as your source file with the
  244.        extension of ".LNK" in the same directory as L.EXE. You may then
  245.        load this file at any time if you desire to recompile your program.
  246.        If the source data field is blank, the program will create a data
  247.        file called LINKER.LNK (the default data file).
  248.  
  249.             You can load a data file into the program in one of two ways.
  250.        You may read a data file from the DOS command line using the command
  251.        line switch /R like this:
  252.  
  253.                                  L /r datafile
  254.  
  255.        where datafile is name of the data file to read. The extension is
  256.        not necessary.
  257.  
  258.             You may read a data file once the program is running by
  259.        pressing the F3 key. This will produce a menu of the available data
  260.        files. Use the arrow keys to highlight a data file to load and press
  261.        ENTER. If you have more data files than will fit on the menu, scroll
  262.        the menu by running the highlight bar off the menu. Press ESC if you
  263.        decide not to read a data file.
  264.  
  265.     2.3 Help
  266.  
  267.             Pressing the F1 key will activate L.EXE's help system. A
  268.        small menu will appear in the middle of the screen listing the
  269.        help topics available to you. Highlight the topic you want help
  270.        on and press the ENTER key to see it. The help system is recursive
  271.        so you may bring up the help menu while in help to view other
  272.        subjects. At the bottom of each help screen are listed all your
  273.        available options. Pressing ESC at any time will exit help and
  274.        return you to the main screen. Please be sure that L.HLP is in the
  275.        same directory as L.EXE or help will not be available!
  276.  
  277.     2.4 Quiet Mode Operation
  278.  
  279.             Start the program with the /Q command line switch if you do not
  280.         want to hear all the beeps and whistles from the program. This will
  281.         silence everything with the exception of BC. BC.EXE is a separate
  282.         program and cannot be silenced.
  283.  
  284.     2.5 Color Configuration
  285.  
  286.             You may set your own color combinations by pressing F4. This
  287.         will present a menu of the configurable options and two sample
  288.         windows. Use the arrow keys to highlight the item you wish to
  289.         change and press ENTER. This will produce a chart of the available
  290.         color combinations. Use the arrow keys to select the color
  291.         combination of your choice and press ENTER. You may exit the color
  292.         chart without selecting a color by pressing ESC.
  293.  
  294.             After setting the colors you have three exiting options. Choose
  295.         "Exit with old colors" to ignore all the changes you have made. If
  296.         you select "Exit with new colors", the new colors will be in effect
  297.         until you exit the program. "Write colors to disk" will create a
  298.         file named L.CFG in the same directory as L.EXE. Doing this will
  299.         set new default colors that will be read by L.EXE every time it
  300.         starts. Use this to permanently set your new colors.
  301.  
  302.     2.6 Text Editor Operation
  303.  
  304.             You may run a text editor directly from L.EXE by pressing ALT-E
  305.         while at the main screen. This will invoke your text editor
  306.         directly. There are no parameters passed to the editor. After
  307.         exiting the editor you will be returned to the main screen.
  308.  
  309.             Press Ctrl-E to specify a different editor for use. This will
  310.         allow you to use your favorite editor to work directly with your
  311.         source code. Your default editor choice is saved when you save your
  312.         color configuration (see the above section).
  313.  
  314.     2.7 Other Information
  315.  
  316.             There are two other keys that have special meaning to L.EXE.
  317.         Pressing ESC while at the main screen will exit the program. The
  318.         TAB key will start the compiling/linking process, as covered in the
  319.         next section.
  320.  
  321.             SECTION THREE: Compiling and Linking your Program
  322.  
  323.     3.1 General Operation
  324.  
  325.             Now that you have entered all the necessary data to create
  326.        your program, press the TAB key and let it fly. L.EXE will first
  327.        locate your source file(s) and then call BC to compile them one
  328.        at a time. If your program compiles with errors L.EXE will
  329.        detect this condition and halt the process. You will then be
  330.        brought back to the main screen where you may be able to correct
  331.        the problem and then try it again.
  332.  
  333.             After a module has compiled without errors, L.EXE will clear
  334.         the archive bit on the source file. When compiling, L.EXE first
  335.         checks for the presence of an object file of the same name as the
  336.         source. If this object file exists, L.EXE then checks the archive
  337.         bit of the source code. If the archive bit is clear, L.EXE will
  338.         skip compiling this module and continue with the next. This
  339.         intelligent selection will really save time on large programs,
  340.         because it will compile only those modules that need compiling.
  341.  
  342.             If everything compiles OK, L.EXE will then call LINK.EXE to
  343.        link your program. L.EXE will set up the link call using the
  344.        switches, libraries, and stub files you specified in the information
  345.        section. Once again L.EXE will supervise the linking process and
  346.        return you to the main screen if an error occurs. If your program
  347.        links without errors L.EXE will automatically exit to DOS so you may
  348.        try out your new program.
  349.  
  350.     3.2 Single 5.25" Drive System:
  351.  
  352.             I'm not going to kid you here. Using a single drive system
  353.        poses some serious limitations to your final program size. You
  354.        will need three blank floppy disks. Label them A, B, and C, then
  355.        set them up as follows:
  356.  
  357.                                 DISK A
  358.                                 ------
  359.                               COMMAND.COM
  360.                               L.EXE
  361.                               BC.EXE
  362.                               LINK.EXE
  363.                               Your source file(s)
  364.  
  365.                                 DISK B
  366.                                 ------
  367.                               BCOM40.LIB or
  368.                               BCOM45.LIB or
  369.                               Other run-time library
  370.                               Any toolbox library
  371.                               Any stub files
  372.  
  373.                                 DISK C
  374.                                 ------
  375.                                 BLANK
  376.  
  377.  
  378.             Start L.EXE from Disk A. Leave the paths to your source
  379.        files, BC and LINK blank. Set the library and object file paths
  380.        to "b:" (without quotes). Set the switches as you desire, but
  381.        include the /PAU switch for LINK. After the above is done press
  382.        the TAB key to start. When LINK starts you will be prompted to
  383.        swap disks in drive a:. When LINK asks for the disk for drive b:
  384.        insert your B disk. You will need to swap disks a couple of more
  385.        times before the process is complete.
  386.  
  387.             Before LINK writes the final executable program, it will ask
  388.        you to place a new disk in drive a:. Insert your final blank disk
  389.        (DISK C) into your drive and push ENTER twice. The third disk
  390.        will now contain your finished program.
  391.  
  392.             You can create an extra 42K of disk space if you start
  393.        L.EXE from a different disk and eliminate it from DISK A. Once
  394.        the main screen appears it is safe to remove the program diskette
  395.        from the drive, although help will not be available.
  396.  
  397.     3.3 Single 3.5" Drive System
  398.  
  399.             This configuration will give you much needed breathing room.
  400.        You can do the entire process from one disk. However, if you
  401.        follow the procedure for a 5.25" drive system (without the third
  402.        blank disk) you can create programs of virtually unlimited size.
  403.        You will still need to swap disks when prompted.
  404.  
  405.     3.4 Dual Drive System (any size drives)
  406.  
  407.             The procedure is basically the same as a single drive
  408.        system. The advantage here is no disk swapping should be needed.
  409.        Put DISK A in drive a: and DISK B in drive b:. For two 5.25"
  410.        drives I still recommend using the /PAU link option and a third
  411.        blank disk.
  412.  
  413.     3.5 Hard Disk System
  414.  
  415.             Here is where you will receive the full benefit of L.EXE's
  416.        services. You are encouraged to separate different type files
  417.        into their own subdirectories. Doing so will make finding
  418.        different files much easier as well as cleaning your QB
  419.        directory up quite nicely. QuickBASIC itself can be set up to use
  420.        multiple sub directories. I believe this promotes good hard disk
  421.        organization.
  422.  
  423.             Another advantage is the speed. L.EXE can compile and link
  424.        your program about three times as fast on a hard disk as on
  425.        floppies. Yet another advantage is in the additions you can make
  426.        to your program. Some toolbox kits will not fit on a floppy disk
  427.        along with a run-time library. Using a hard disk means you can
  428.        use two, three, or more libraries and three or four stub files
  429.        without fear of the "Disk Full" error.
  430.  
  431.             To use L.EXE on a hard disk just enter the path information
  432.        into the proper areas and use it. L.EXE was designed to be run from
  433.        a directory in your PATH on an empty directory. You are still free
  434.        to choose the method that suits you best.
  435.  
  436.     3.6 Command Line Operation
  437.  
  438.             L.EXE can operate in batch mode for use in batch files. This
  439.         requires a data file that contains enough information to compile
  440.         and link a program. Invoke batch mode by using the /C command line
  441.         switch like this:
  442.                                  L /c datafile
  443.  
  444.         where datafile is the name of the data file describing the source
  445.         code you wish to compile and link. When started in this manner,
  446.         L.EXE will first examine the file for accuracy, and then
  447.         immediately compile and link your program. Should any errors occur
  448.         L.EXE will set the DOS ERRORLEVEL to a value of 50. You may then
  449.         test for this condition to determine the success of the operation.
  450.  
  451.             At no time during batch operation will the main screen be
  452.         shown. If an error occurs, the process of compiling and linking is
  453.         halted and the program exits with the ERRORLEVEL set. Any error at
  454.         all will print an error message and exit.
  455.  
  456.                         SECTION FOUR: Other Information
  457.  
  458.     4.1 Site License Agreement
  459.  
  460.             This program is distributed by the Shareware concept. It is
  461.        not free. You are granted limited license to use L.EXE on your
  462.        system to determine its suitability.
  463.  
  464.             You are encouraged to give L.EXE to your friends and upload
  465.        it on your favorite BBS provided you adhere to these terms:
  466.  
  467.             You cannot charge a fee for the program. You may charge a
  468.             distribution fee if you advise users this fee is for distri-
  469.             bution purposes only and not for the program itself.
  470.  
  471.             You must include all the files included with this package in
  472.             complete and unmodified form.
  473.  
  474.             If you find this utility helpful and plan to use it on your
  475.        system, please register your copy. Registration provides complete
  476.        support for this program, update notices, and the latest version on
  477.        disk. The registration form is in the text file REGISTER.DOC
  478.        included with this package.
  479.  
  480.     4.2 Disclaimer
  481.  
  482.             This program is supplied as-is, with no warranty of any kind
  483.         either written or implied. Sequential Software Ltd. and Robin Duffy
  484.         can assume no liability for any damages (either real or imagined)
  485.         resulting from the use of this software. Furthermore, we make no
  486.         guarantee as to the suitability of this software for any purpose.
  487.  
  488.     4.3 Final Words
  489.  
  490.             I would like to thank you for trying this program. BASIC has an
  491.         undeserved stigma of not being a real language. I, in my own little
  492.         way, hope to erase this stigma and reveal BASIC as a valid tool to
  493.         create useful applications. Perhaps a make utility such as this
  494.         will provide flexibility to programmers, who in turn can get the
  495.         most from their programs in terms of size and speed. Perhaps you
  496.         are one of these programmers.
  497.  
  498.  
  499.  
  500.  
  501.                               SUPPORT SHAREWARE!
  502.  
  503.